Patch xgselect.c to prevent hang when using newer versions of GLib.
Thanks to Vincent Lefevre <vincent@vinc17.net> and Sven Arvidsson
<sa@whiz.se> for the initial reports, and Karel Klíč
<kklic@redhat.com> for the patch.
Closes: #666691
--- /dev/null
- 54367a0ec537b4bc361783b9b375b9cbd7d48483
- 54367a0ec537b4bc361783b9b375b9cbd7d48483
+# see git-dpm(1) from git-dpm package
++c566c20428a35fb0d29960819ef0034808f4cd12
++c566c20428a35fb0d29960819ef0034808f4cd12
+4edc7f7569f39278c30a9a64da6e0b313bbed458
+4edc7f7569f39278c30a9a64da6e0b313bbed458
+emacs23_23.4+1.orig.tar.bz2
+155466351ad8e2e10af8a1f7f23af0a801cf7db2
+23111569
--- /dev/null
- 1 files changed, 11 insertions(+), 0 deletions(-)
+From 730582ceef35035f2379283f0b8b7f211194351c Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:21 -0500
+Subject: Prefer /usr/share/info/emacs-23 over /usr/share/info.
+
+Emacs will prefer /usr/share/info/emacs-23 over /usr/share/info.
+
+The value of Info-default-directory-list has been augmented via
+site-init.el to include /usr/share/info/emacs-23 before
+/usr/share/info.
+---
+ lisp/site-init.el | 11 +++++++++++
++ 1 file changed, 11 insertions(+)
+ create mode 100644 lisp/site-init.el
+
+diff --git a/lisp/site-init.el b/lisp/site-init.el
+new file mode 100644
+index 0000000..d8d6256
+--- /dev/null
++++ b/lisp/site-init.el
+@@ -0,0 +1,11 @@
++
++;; Add the flavor specific directory for Debian.
++(setq Info-default-directory-list
++ (let ((result nil)
++ (found-match nil))
++ (dolist (elt Info-default-directory-list (nreverse result))
++ (if (and (not found-match) (equal elt "/usr/share/info/"))
++ (progn
++ (push "/usr/share/info/emacs-23" result)
++ (setq found-match t)))
++ (push elt result))))
--- /dev/null
- 1 files changed, 19 insertions(+), 2 deletions(-)
+From 6a31be0e038e528e0d790203851a20e7e6ae4a5a Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:22 -0500
+Subject: Run debian-startup and set debian-emacs-flavor.
+
+Emacs runs debian-startup and sets debian-emacs-flavor.
+
+* Emacs runs debian-startup during the startup process unless
+ site-run-file is false.
+
+* The global variable debian-emacs-flavor is bound to 'emacs23.
+ Author: Rob Browning <rlb@defaultvalue.org>
+---
+ lisp/startup.el | 21 +++++++++++++++++++--
++ 1 file changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/lisp/startup.el b/lisp/startup.el
+index 775d2f7..b3e56ad 100644
+--- a/lisp/startup.el
++++ b/lisp/startup.el
+@@ -393,6 +393,10 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
+ :type 'directory
+ :initialize 'custom-initialize-delay)
+
++(defconst debian-emacs-flavor 'emacs23
++ "A symbol representing the particular debian flavor of emacs running.
++Something like 'emacs20, 'xemacs20, etc.")
++
+ (defun normal-top-level-add-subdirs-to-load-path ()
+ "Add all subdirectories of current directory to `load-path'.
+ More precisely, this uses only the subdirectories whose names
+@@ -955,8 +959,21 @@ opening the first frame (e.g. open a connection to an X server).")
+ ;; be loaded from site-run-file and wants to test if -q was given
+ ;; should check init-file-user instead, since that is already set.
+ ;; See cus-edit.el for an example.
+- (if site-run-file
+- (load site-run-file t t))
++
++ ;; Original upstream startup
++ ;; (if site-run-file
++ ;; (load site-run-file t t))
++ ;;
++
++ ;; Debian startup
++ (if site-run-file
++ (progn
++ ;; Load all the debian package snippets.
++ ;; It's in here because we want -q to kill it too.
++ (if (load "debian-startup" t t nil)
++ (debian-startup debian-emacs-flavor))
++ ;; Now the normal site file...
++ (load site-run-file t t nil)))
+
+ ;; Sites should not disable this. Only individuals should disable
+ ;; the startup screen.
--- /dev/null
- 1 files changed, 5 insertions(+), 0 deletions(-)
+From 99c51fcfe11469feff7e943ab783ddab7f75fcd2 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:25 -0500
+Subject: Adjust documentation references for Debian.
+
+Various documentation references have been adjusted for Debian.
+
+References to /usr/local/... have been changed to /usr/... as
+appropriate, etc.
+---
+ etc/NEWS | 5 +++++
++ 1 file changed, 5 insertions(+)
+
+diff --git a/etc/NEWS b/etc/NEWS
+index 136bdf1..bb5f6b3 100644
+--- a/etc/NEWS
++++ b/etc/NEWS
+@@ -14,6 +14,11 @@ for changes in older Emacs versions.
+ You can narrow news to a specific version by calling `view-emacs-news'
+ with a prefix argument or by typing C-u C-h C-n.
+
++ \f
++* Debian specific changes to Emacs
++
++Please see /usr/share/doc/emacs23-common/README.Debian.gz.
++
+ \f
+ * Installation Changes in Emacs 23.4
+
--- /dev/null
- 2 files changed, 8 insertions(+), 0 deletions(-)
+From e8cb9f40dca14735f4c5f20aefd5c8371cea5ed2 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:26 -0500
+Subject: Cause the build to fail if liblockfile isn't selected for movemail.
+
+The build will fail if liblockfile isn't selected for movemail.
+
+This makes sure the Debian Emacs won't accidentally be built with the
+wrong locking strategy. To disable this check, comment out
+require-movemail-use-liblockfile.diff in debian/patches/series.
+
+Author: Rob Browning <rlb@defaultvalue.org>
+Added-by: Rob Browning <rlb@defaultvalue.org>
+---
+ lib-src/movemail.c | 4 ++++
+ src/s/bsd-common.h | 4 ++++
++ 2 files changed, 8 insertions(+)
+
+diff --git a/lib-src/movemail.c b/lib-src/movemail.c
+index d6fc1ce..ec38678 100644
+--- a/lib-src/movemail.c
++++ b/lib-src/movemail.c
+@@ -166,6 +166,10 @@ int mbx_delimit_end ();
+ /* Nonzero means this is name of a lock file to delete on fatal error. */
+ char *delete_lockname;
+
++#ifndef MAIL_USE_MAILLOCK
++#error "Debian requires that mail locking be handled by liblockfile."
++#endif /* ndef MAIL_USE_MAILLOCK */
++
+ int
+ main (argc, argv)
+ int argc;
+diff --git a/src/s/bsd-common.h b/src/s/bsd-common.h
+index 4179d33..70a4a1a 100644
+--- a/src/s/bsd-common.h
++++ b/src/s/bsd-common.h
+@@ -66,7 +66,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+ The alternative is that a lock file named
+ /usr/spool/mail/$USER.lock. */
+
++/* conditional copied from gnu-linux.h */
++#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
++ defined (HAVE_MAILLOCK_H))
+ #define MAIL_USE_FLOCK
++#endif
+
+ /* Define CLASH_DETECTION if you want lock files to be written
+ so that Emacs can tell instantly when you try to modify
--- /dev/null
- 1 files changed, 2 insertions(+), 2 deletions(-)
+From ace4b4626bfb0bfc2b0b4afce210c086afa86bbf Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:28 -0500
+Subject: Modify the output of (version) to indicate Debian modifications.
+
+The output of (version) has been modified to indicate Debian modifications.
+
+Author: Rob Browning <rlb@defaultvalue.org>
+Added-by: Rob Browning <rlb@defaultvalue.org>
+---
+ lisp/version.el | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lisp/version.el b/lisp/version.el
+index ebd4fea..b8107e6 100644
+--- a/lisp/version.el
++++ b/lisp/version.el
+@@ -56,8 +56,8 @@ to the system configuration; look at `system-configuration' instead."
+ (interactive "P")
+ (let ((version-string
+ (format (if (not (called-interactively-p 'interactive))
+- "GNU Emacs %s (%s%s%s)\n of %s on %s"
+- "GNU Emacs %s (%s%s%s) of %s on %s")
++ "GNU Emacs %s (%s%s%s)\n of %s on %s, modified by Debian"
++ "GNU Emacs %s (%s%s%s) of %s on %s, modified by Debian")
+ emacs-version
+ system-configuration
+ (cond ((featurep 'motif)
--- /dev/null
- 1 files changed, 2 insertions(+), 2 deletions(-)
+From 54e9d1a87ea67bd2ae5933bd9c1542cb2803bcf8 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:29 -0500
+Subject: Look for NEWS in order to find etc/ rather than GNU.
+
+Emacs will now look for NEWS in order to find etc/ rather than GNU.
+
+Since Debian doesn't include GNU in the Debian packages (the common
+licenses are in /usr/share/common-licenses), Emacs will now look for
+NEWS to find the etc directory instead of GNU.
+
+Provided-by: Sven Joachim <svenjoac@gmx.de>
+Originally-reported-by: Bernhard Michler <Boregard@gmx.net>
+Date: Mon, 28 Apr 2008 11:20:23 +0200
+Added-by: Rob Browning <rlb@defaultvalue.org>
+Status: Debian specific
+---
+ src/callproc.c | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/callproc.c b/src/callproc.c
+index 6898bd9..84b1c30 100644
+--- a/src/callproc.c
++++ b/src/callproc.c
+@@ -1509,14 +1509,14 @@ init_callproc ()
+
+ srcdir = Fexpand_file_name (build_string ("../src/"),
+ build_string (PATH_DUMPLOADSEARCH));
+- tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
++ tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory);
+ tem1 = Ffile_exists_p (tem);
+ if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
+ {
+ Lisp_Object newdir;
+ newdir = Fexpand_file_name (build_string ("../etc/"),
+ build_string (PATH_DUMPLOADSEARCH));
+- tem = Fexpand_file_name (build_string ("GNU"), newdir);
++ tem = Fexpand_file_name (build_string ("NEWS"), newdir);
+ tem1 = Ffile_exists_p (tem);
+ if (!NILP (tem1))
+ Vdata_directory = newdir;
--- /dev/null
- 1 files changed, 1 insertions(+), 1 deletions(-)
+From 5b1eadbfa938bc5dc8e623ece55dbc378e70ce3f Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:30 -0500
+Subject: Invoke the correct xmlstarlet executable on Debian systems.
+
+Emacs now invokes the correct xmlstarlet executable on Debian systems.
+
+Emacs invokes xmlstarlet rather than xml, which is the correct
+executable name on Debian systems.
+
+Provided-by: Jussi Judin <jjudin+debian@iki.fi>
+Date: Sat, 20 Oct 2007 14:42:02 UTC
+Added-by: Rob Browning <rlb@defaultvalue.org>
+Status: Debian specific
+Bug: 447378
+---
+ lisp/progmodes/flymake.el | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
+index de7034f..4d21371 100644
+--- a/lisp/progmodes/flymake.el
++++ b/lisp/progmodes/flymake.el
+@@ -1760,7 +1760,7 @@ Use CREATE-TEMP-F for creating temp copy."
+
+ ;;;; xml-specific init-cleanup routines
+ (defun flymake-xml-init ()
+- (list "xml" (list "val" (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace))))
++ (list "xmlstarlet" (list "val" (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace))))
+
+ (provide 'flymake)
+
--- /dev/null
- 1 files changed, 5 insertions(+), 0 deletions(-)
+From f4f49db3a1e1868f269d33ae69c2b52b2b8f8f06 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Mon, 4 Apr 2011 22:46:32 -0500
+Subject: Fix startup hang on Debian GNU/kFreeBSD.
+
+Emacs should no longer hang on startup on Debian GNU/kFreeBSD.
+
+Date: Thu Aug 12 04:21:09 UTC 2010
+Added-by: Rob Browning <rlb@defaultvalue.org>
+Provided-By: Petr Salinger <Petr.Salinger@seznam.cz>
+Bug: 559392
+Status: new
+---
+ src/s/gnu-kfreebsd.h | 5 +++++
++ 1 file changed, 5 insertions(+)
+
+diff --git a/src/s/gnu-kfreebsd.h b/src/s/gnu-kfreebsd.h
+index a1e8c02..89563de 100644
+--- a/src/s/gnu-kfreebsd.h
++++ b/src/s/gnu-kfreebsd.h
+@@ -5,6 +5,11 @@
+ #undef SYSTEM_TYPE
+ #define SYSTEM_TYPE "gnu/kfreebsd" /* All the best software is free */
+
++#undef INTERRUPT_INPUT
++#define BROKEN_SIGIO
++#define BROKEN_SIGURG
++#define BROKEN_SIGPOLL
++
+ #define NO_TERMIO /* use only <termios.h> */
+
+ /* arch-tag: 8d098200-2586-469e-99ab-6d092c035e03
--- /dev/null
- 1 files changed, 2 insertions(+), 0 deletions(-)
+From 8a1d66b717aedf49c61b56b2ad3ce2d3ba9b7ce7 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 29 Jan 2012 13:34:44 -0600
+Subject: Define POSIX_SIGNALS for GNU/Hurd.
+
+Emacs will now use POSIX signals on GNU/Hurd which avoids a build
+failure when a 15MiB-long write is interrupted by a signal, and Emacs
+hasn't set the SA_RESTART flag.
+
+Author: Samuel Thibault <sthibault@debian.org>
+Date: Sun, 4 Dec 2011 19:47:54 +0100
+Applied-By: Rob Browning <rlb@defaultvalue.org>
+Forwarded: bug-gnu-emacs@gnu.org
+Closes: #650976
+---
+ src/s/gnu.h | 2 ++
++ 1 file changed, 2 insertions(+)
+
+diff --git a/src/s/gnu.h b/src/s/gnu.h
+index 388b3e3..51e6ec4 100644
+--- a/src/s/gnu.h
++++ b/src/s/gnu.h
+@@ -83,5 +83,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+ #endif /* !_IO_STDIO_H */
+ #endif /* emacs */
+
++#define POSIX_SIGNALS 1
++
+ /* arch-tag: 577983d9-87a6-4922-b8f8-ff2b563714a4
+ (do not change this comment) */
--- /dev/null
- 1 files changed, 16 insertions(+), 18 deletions(-)
+From 937769ea76b5787bb334678c8685692859128b66 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 29 Jan 2012 13:42:57 -0600
+Subject: Add a printf attribute to movemail.c to allow hardened build flags.
+
+Emacs should now support the -Wformat -Wformat-security
+-Werror=format-security build flags.
+
+Reported-by: Moritz Muehlenhoff <jmm@debian.org>
+Author: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 29 Jan 2012 13:51:13 -0600
+Forwarded: bug-gnu-emacs@gnu.org
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655118
+Applied-By: Rob Browning <rlb@defaultvalue.org>
+---
+ lib-src/movemail.c | 34 ++++++++++++++++------------------
++ 1 file changed, 16 insertions(+), 18 deletions(-)
+
+diff --git a/lib-src/movemail.c b/lib-src/movemail.c
+index ec38678..74ae004 100644
+--- a/lib-src/movemail.c
++++ b/lib-src/movemail.c
+@@ -60,6 +60,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+ #include <sys/file.h>
+ #include <stdio.h>
+ #include <errno.h>
++#include <stdarg.h>
+ #include <time.h>
+
+ #include <getopt.h>
+@@ -152,7 +153,7 @@ extern char *rindex __P((const char *, int));
+ #endif
+
+ void fatal ();
+-void error ();
++void error (const char *template, ...) __attribute__ ((format (printf, 1, 2)));
+ void pfatal_with_name ();
+ void pfatal_and_delete ();
+ char *concat ();
+@@ -610,16 +611,13 @@ fatal (s1, s2, s3)
+ are args for it or null. */
+
+ void
+-error (s1, s2, s3)
+- char *s1, *s2, *s3;
++error (const char *template, ...)
+ {
++ va_list ap;
+ fprintf (stderr, "movemail: ");
+- if (s3)
+- fprintf (stderr, s1, s2, s3);
+- else if (s2)
+- fprintf (stderr, s1, s2);
+- else
+- fprintf (stderr, s1);
++ va_start (ap, template);
++ vfprintf (stderr, template, ap);
++ va_end (ap);
+ fprintf (stderr, "\n");
+ }
+
+@@ -733,13 +731,13 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ server = pop_open (hostname, user, password, POP_NO_GETPASS);
+ if (! server)
+ {
+- error ("Error connecting to POP server: %s", pop_error, 0);
++ error ("Error connecting to POP server: %s", pop_error);
+ return EXIT_FAILURE;
+ }
+
+ if (pop_stat (server, &nmsgs, &nbytes))
+ {
+- error ("Error getting message count from POP server: %s", pop_error, 0);
++ error ("Error getting message count from POP server: %s", pop_error);
+ return EXIT_FAILURE;
+ }
+
+@@ -761,7 +759,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ if ((mbf = fdopen (mbfi, "wb")) == NULL)
+ {
+ pop_close (server);
+- error ("Error in fdopen: %s", strerror (errno), 0);
++ error ("Error in fdopen: %s", strerror (errno));
+ close (mbfi);
+ unlink (outfile);
+ return EXIT_FAILURE;
+@@ -785,7 +783,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ mbx_delimit_begin (mbf);
+ if (pop_retr (server, i, mbf) != OK)
+ {
+- error ("%s", Errmsg, 0);
++ error ("%s", Errmsg);
+ close (mbfi);
+ return EXIT_FAILURE;
+ }
+@@ -793,7 +791,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ fflush (mbf);
+ if (ferror (mbf))
+ {
+- error ("Error in fflush: %s", strerror (errno), 0);
++ error ("Error in fflush: %s", strerror (errno));
+ pop_close (server);
+ close (mbfi);
+ return EXIT_FAILURE;
+@@ -809,14 +807,14 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ #ifdef BSD_SYSTEM
+ if (fsync (mbfi) < 0)
+ {
+- error ("Error in fsync: %s", strerror (errno), 0);
++ error ("Error in fsync: %s", strerror (errno));
+ return EXIT_FAILURE;
+ }
+ #endif
+
+ if (close (mbfi) == -1)
+ {
+- error ("Error in close: %s", strerror (errno), 0);
++ error ("Error in close: %s", strerror (errno));
+ return EXIT_FAILURE;
+ }
+
+@@ -825,7 +823,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+ {
+ if (pop_delete (server, i))
+ {
+- error ("Error from POP server: %s", pop_error, 0);
++ error ("Error from POP server: %s", pop_error);
+ pop_close (server);
+ return EXIT_FAILURE;
+ }
+@@ -833,7 +831,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
+
+ if (pop_quit (server))
+ {
+- error ("Error from POP server: %s", pop_error, 0);
++ error ("Error from POP server: %s", pop_error);
+ return EXIT_FAILURE;
+ }
+
--- /dev/null
- 2 files changed, 5 insertions(+), 1 deletions(-)
+From 54367a0ec537b4bc361783b9b375b9cbd7d48483 Mon Sep 17 00:00:00 2001
+From: Kenichi Handa <handa@m17n.org>
+Date: Sun, 4 Mar 2012 21:05:23 +0900
+Subject: quail/indian.el (indian-tlg-base-table): Fix typo; dev -> tlg.
+
+In quail/indian.el, indian-dev-base-table has been corrected to
+indian-tlg-base-table.
+
+Applied-By: Rob Browning <rlb@defaultvalue.org>
+Origin: upstream, commit: 141162dace9e05123a73dfe6d8be921840ff2416
+---
+ leim/ChangeLog | 4 ++++
+ leim/quail/indian.el | 2 +-
++ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/leim/ChangeLog b/leim/ChangeLog
+index 1a8c37a..7ca7270 100644
+--- a/leim/ChangeLog
++++ b/leim/ChangeLog
+@@ -1,3 +1,7 @@
++2012-03-04 Kenichi Handa <handa@m17n.org>
++
++ * quail/indian.el (indian-tlg-base-table): Fix typo; dev -> tlg.
++
+ 2012-01-19 Chong Yidong <cyd@gnu.org>
+
+ * Version 23.4 released.
+diff --git a/leim/quail/indian.el b/leim/quail/indian.el
+index d92fef5..6d4ecbf 100644
+--- a/leim/quail/indian.el
++++ b/leim/quail/indian.el
+@@ -269,7 +269,7 @@
+ (if nil
+ (quail-define-package "telugu-inscript" "Telugu" "TlgIS" t "Telugu keyboard Inscript"))
+ (quail-define-inscript-package
+- indian-dev-base-table inscript-dev-keytable
++ indian-tlg-base-table inscript-dev-keytable
+ "telugu-inscript" "Telugu" "TlgIS"
+ "Telugu keyboard Inscript.")
+
--- /dev/null
--- /dev/null
++From c566c20428a35fb0d29960819ef0034808f4cd12 Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Karel=20Kl=C3=AD=C4=8D?= <kklic@redhat.com>
++Date: Fri, 25 Nov 2011 16:36:04 +0100
++Subject: Initialize xgselect in function xg_select when gfds_size == 0.
++
++Emacs should no longer hang when using newer versions of GLib
++(initially reported against libglib2.0-0 2.32.0-2).
++
++Origin: http://pkgs.fedoraproject.org/gitweb/?p=emacs.git;a=commitdiff;h=a2302b156dba1cc136e8363605d78a66eb3a92a6
++Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9754
++Bug-Red-Hat: https://bugzilla.redhat.com/show_bug.cgi?id=711739
++Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666691
++Applied-Upstream: Fixed in Emacs 24
++---
++ src/xgselect.c | 13 +++++++++----
++ 1 file changed, 9 insertions(+), 4 deletions(-)
++
++diff --git a/src/xgselect.c b/src/xgselect.c
++index 333f7b1..7bb5f00 100644
++--- a/src/xgselect.c
+++++ b/src/xgselect.c
++@@ -55,10 +55,15 @@ xg_select (max_fds, rfds, wfds, efds, timeout)
++ do {
++ if (n_gfds > gfds_size)
++ {
++- while (n_gfds > gfds_size)
++- gfds_size *= 2;
++- xfree (gfds);
++- gfds = xmalloc (sizeof (*gfds) * gfds_size);
+++ if (gfds_size == 0)
+++ xgselect_initialize ();
+++ else
+++ {
+++ while (n_gfds > gfds_size)
+++ gfds_size *= 2;
+++ xfree (gfds);
+++ gfds = xmalloc (sizeof (*gfds) * gfds_size);
+++ }
++ }
++
++ n_gfds = g_main_context_query (context,
--- /dev/null
+0001-Prefer-usr-share-info-emacs-23-over-usr-share-info.patch
+0002-Run-debian-startup-and-set-debian-emacs-flavor.patch
+0003-Remove-files-that-appear-to-be-incompatible-with-the.patch
+0004-Adjust-documentation-references-for-Debian.patch
+0005-Cause-the-build-to-fail-if-liblockfile-isn-t-selecte.patch
+0006-Avoid-silently-losing-mail-via-fakemail.patch
+0007-Modify-the-output-of-version-to-indicate-Debian-modi.patch
+0008-Look-for-NEWS-in-order-to-find-etc-rather-than-GNU.patch
+0009-Invoke-the-correct-xmlstarlet-executable-on-Debian-s.patch
+0010-Fix-startup-hang-on-Debian-GNU-kFreeBSD.patch
+0011-Use-CRT_DIR-to-find-crt-.o-on-ppc64.patch
+0012-Define-POSIX_SIGNALS-for-GNU-Hurd.patch
+0013-Add-a-printf-attribute-to-movemail.c-to-allow-harden.patch
+0014-Fix-hang-after-C-z-in-gnome-shell.patch
+0015-coding.c-produce_chars-Fix-updating-of-src_end-Bug-1.patch
+0016-quail-indian.el-indian-tlg-base-table-Fix-typo-dev-t.patch
++0017-Initialize-xgselect-in-function-xg_select-when-gfds_.patch